package com.atguigu.tingshu.album.service.impl;

import com.atguigu.tingshu.album.mapper.BaseAttributeMapper;
import com.atguigu.tingshu.album.mapper.BaseCategory1Mapper;
import com.atguigu.tingshu.album.mapper.BaseCategory3Mapper;
import com.atguigu.tingshu.album.service.BaseCategoryService;
import com.atguigu.tingshu.model.album.BaseCategory1;
import com.atguigu.tingshu.model.album.BaseCategory3;
import com.atguigu.tingshu.vo.album.AttributeVo;
import com.atguigu.tingshu.vo.album.BaseCategoryVo;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@SuppressWarnings({"unchecked", "rawtypes"})
public class BaseCategoryServiceImpl extends ServiceImpl<BaseCategory1Mapper, BaseCategory1> implements BaseCategoryService {

	@Autowired
	private BaseCategory1Mapper baseCategory1Mapper;

	@Autowired
	private BaseCategory3Mapper baseCategory3Mapper;

	@Autowired
	private BaseAttributeMapper baseAttributeMapper;

	@Override
	public List<BaseCategoryVo> getBaseCategoryList(Long category1Id) {
		return baseCategory1Mapper.getBaseCategoryList(category1Id);
	}

	@Override
	public List<AttributeVo> findAttribute(Long categoryId) {
		return baseAttributeMapper.findAttribute(categoryId);
	}

	@Override
	public List<BaseCategory3> findTopBaseCategory3(Long category1Id) {
		return baseCategory3Mapper.findTopBaseCategory3(category1Id);
	}
}
